﻿using JNPF.Common.Security;
using JNPF.Common.Models;
using JNPF.Website.Entitys.Dto.WebsiteBanner;
using Mapster;

namespace JNPF.Website.Entitys.Mapper.WebsiteBanner;

public class Mapper : IRegister
{
	public void Register(TypeAdapterConfig config)
	{
		config.ForType<WebsiteBannerCrInput, WebsiteBannerEntity>()
			.Map(dest => dest.Image, src => src.image.ToJsonString())
		;
		config.ForType<WebsiteBannerEntity, WebsiteBannerInfoOutput>()
			.Map(dest => dest.image, src => src.Image.ToObject<List<FileControlsModel>>())
		;
	}
}
